home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Installer SDK Cornucopia 1.0.2 / Script Examples / File Compression⁄Split Example / Makefile < prev   
Encoding:
Makefile  |  1996-09-30  |  6.2 KB  |  148 lines  |  [TEXT/MPS ]

  1. #
  2. #    makefile for "fileCompress.r", the example for InstaCompOne file compression
  3. #
  4. #
  5. #        to build installer script :
  6. #            1) select "Build" from "Build" menu
  7. #            2) type script name "fileCompressSplit" ( note: ".r" is omitted )
  8. #            
  9. #        to build debug version of installer script :
  10. #            1) select "Build" from "Build" menu
  11. #            2) type script name "fileCompressSplit.debug" ( note: ".r" is omitted )
  12. #
  13. #
  14.  
  15. # • script names
  16.  
  17. # the installer script name
  18. scriptName                = fileCompressSplit
  19. # the debug version installer script name
  20. debugScriptName            = {scriptName}.debug
  21. # filename for ScriptCheck extension that will run when ScriptCheck does
  22. localScriptCheckExtName    = {scriptName}.scx
  23.  
  24. # • tool names
  25.  
  26. # • support directory names
  27.  
  28. # directory where ScriptCheck MPW tool can be found
  29. ScriptCheckDir            = :::Tools:Released:ScriptCheck 4.0.3:
  30. # directory where RIncludes can be found
  31. InstallerRIncDir        = :::DeveloperInterfaces:RIncludes:
  32. # directory where the Installer Debugger can be found
  33. InstallerDebuggerDir    = :::Tools:Released:Installer Debugger 4.0.3:
  34. # directory where the InstaCompOne stuff can be found
  35. InstaCompOneDir            = :::Tools:Released:InstaCompOne 1.1:
  36.  
  37.  
  38. # InstaCompOne compression tool
  39. compressTool            = {InstaCompOneDir}InstaCompOneTool
  40.  
  41. # Splitting tool
  42. splitTool                = {InstaCompOneDir}FileAndRsrcSplitterTool
  43.  
  44. # Original ScriptCheck Extension
  45. ScriptCheckExtension    = {InstaCompOneDir}InstaCompOneSCExt.rsrc
  46.  
  47.  
  48. # • simple compression example
  49.  
  50. # source file to be compressed
  51. SimpleSourceFileName    = Example File • 1
  52. # archive file to be compressed into
  53. SimpleArchiveName        = :Disk 1:Tome
  54.  
  55. # • split compression example
  56.  
  57. # source file to be split and compressed
  58. SplitCompSourceFileName        = Example File • 2
  59. # base name to use for files resulting from splitting operation 
  60. SplitCompFileName            = splitCompExFile
  61. # first interim file resulting from splitting operation
  62. SplitCompFileName1            = splitCompExFile.rsrc1                
  63. # second interim file resulting from splitting operation
  64. SplitCompFileName2            = splitCompExFile.rsrc2                
  65. # third interim file resulting from splitting operation
  66. SplitCompFileName3            = splitCompExFile.data1            
  67. # archive resulting from compression of first interim file
  68. SplitCompArchiveName1        = :Disk 1:splitCompTome1            
  69. # archive resulting from compression of second interim file
  70. SplitCompArchiveName2        = :Disk 2:splitCompTome2
  71. # archive resulting from compression of third interim file
  72. SplitCompArchiveName3        = :Disk 2:splitCompTome3
  73.  
  74. # • split w/o compression example
  75.  
  76. # source file to be split, but not compressed
  77. SplitSourceFileName            = Example File • 3
  78. # base name to use for files resulting from splitting operation 
  79. SplitFileName                = splitExFile
  80. # first interim file resulting from splitting operation
  81. SplitFileName1                = splitExFile.rsrc1
  82. # second interim file resulting from splitting operation
  83. SplitFileName2                = splitExFile.rsrc2
  84. # third interim file resulting from splitting operation
  85. SplitFileName3                = splitExFile.data1
  86. # first archive resulting from splitting of file
  87. SplitArchiveName1            = :Disk 1:splitTome1
  88. # second archive resulting from splitting of file
  89. SplitArchiveName2            = :Disk 2:splitTome2
  90. # third archive resulting from splitting of file
  91. SplitArchiveName3            = :Disk 2:splitTome3
  92.  
  93.  
  94.  
  95. # make the debug version of finished installer script
  96. "{debugScriptName}" ƒ "{scriptName}"
  97.     # make a copy of the finished installer script and rename the copy
  98.     Duplicate -y "{scriptName}" "{scriptName} w/ Debugger"
  99.     # add the installer debugger resources to the copied installer script
  100.     Rez -m "{InstallerDebuggerDir}Installer Debugger.r" -append -o "{scriptName} w/ Debugger"
  101.  
  102. # make the standard version of finished installer script
  103. "{scriptName}" ƒ makefile "{scriptName}.r" "{SimpleArchiveName}" "{SplitCompArchiveName1}" "{SplitArchiveName1}" "{localScriptCheckExtName}"
  104.     # establish current date with time of NOON
  105.     set theTime    "'`date -d -s` 12:00:00 PM'"
  106.     # rez the installer source into the form that the installer can read
  107.     Rez "{scriptName}.r" -o "{scriptName}" -t 'kajr' -c 'kajr' -i "{InstallerRIncDir}" 
  108.     # establish filename for finished installer script, set creation date and time, set attributes
  109.     SetFile -a b -d {theTime} "{scriptName}"
  110.     # run scriptcheck utility on the rezzed installer script
  111.     "{ScriptCheckDir}ScriptCheck" "{scriptName}" -h -d -a
  112.     # set modification date and time for finished installer script
  113.     SetFile -m {theTime} "{scriptName}"
  114.  
  115. # be sure that's there's a copy of the InstaCompOne ScriptCheck extension in current folder
  116. "{localScriptCheckExtName}" ƒ "{ScriptCheckExtension}"
  117.     # copy and rename the original scriptcheck extension
  118.     Duplicate -y "{ScriptCheckExtension}" "{localScriptCheckExtName}"
  119.  
  120. # do the simple compression
  121. "{SimpleArchiveName}" ƒ makefile "{SimpleSourceFileName}"
  122.     # compress entire source file into one archive
  123.     "{compressTool}" "{SimpleSourceFileName}" -o "{SimpleArchiveName}"
  124.  
  125. # do the split compression
  126. "{SplitCompArchiveName1}" ƒ makefile "{SplitCompSourceFileName}"
  127.     # split source file into parts no larger than 1650 bytes - place in two interim files
  128.     "{splitTool}" "{SplitCompSourceFileName}" -s 1650 -o "{SplitCompFileName}"
  129.     # compress contents of first interim resource fork file into first archive
  130.     "{compressTool}" "{SplitCompFileName1}" -o "{SplitCompArchiveName1}" -f "{SplitCompSourceFileName}" -e
  131.     # compress contents of second interim resource fork file into second archive
  132.     "{compressTool}" "{SplitCompFileName2}" -o "{SplitCompArchiveName2}" -f "{SplitCompSourceFileName}" -e
  133.     # create archive with data fork of split file by copying data fork interim file
  134.     # (don't compress contents of data fork because we won't gain anything)
  135.     Duplicate -y "{SplitCompFileName3}" "{SplitCompArchiveName3}"
  136.  
  137. # do the split w/o compression
  138. "{SplitArchiveName1}" ƒ makefile "{SplitSourceFileName}"
  139.     # split source file into parts no larger than 1650 bytes - place in two interim files
  140.     "{splitTool}" "{SplitSourceFileName}" -s 1650 -o "{SplitFileName}"
  141.     # create archive with first part of split file by copying first interim file
  142.     Duplicate -y "{SplitFileName1}" "{SplitArchiveName1}"
  143.     # create archive with second part of split file by copying second interim file
  144.     Duplicate -y "{SplitFileName2}" "{SplitArchiveName2}"
  145.     # create archive with data fork of split file by copying data fork interim file
  146.     Duplicate -y "{SplitFileName3}" "{SplitArchiveName3}"
  147.  
  148.